//
// CPSEmitterRectangle.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CVector;
import org.ryzom.nel.misc.IStream;

public class CPSEmitterRectangle extends CPSEmitter {
  private long swigCPtr;

  public CPSEmitterRectangle(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CPSEmitterRectangle_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CPSEmitterRectangle obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CPSEmitterRectangle(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public CPSEmitterRectangle() {
    this(nel3dJNI.new_CPSEmitterRectangle(), true);
  }

  public void serial(IStream f) {
    nel3dJNI.CPSEmitterRectangle_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public void emit(CVector srcPos, long index, CVector pos, CVector speed) {
    nel3dJNI.CPSEmitterRectangle_emit(swigCPtr, this, CVector.getCPtr(srcPos), srcPos, index, CVector.getCPtr(pos), pos, CVector.getCPtr(speed), speed);
  }

  public void setDir(CVector v) {
    nel3dJNI.CPSEmitterRectangle_setDir(swigCPtr, this, CVector.getCPtr(v), v);
  }

  public CVector getDir() {
    return new CVector(nel3dJNI.CPSEmitterRectangle_getDir(swigCPtr, this), true);
  }

  public void showTool() {
    nel3dJNI.CPSEmitterRectangle_showTool(swigCPtr, this);
  }

  public boolean supportUniformScaling() {
    return nel3dJNI.CPSEmitterRectangle_supportUniformScaling(swigCPtr, this);
  }

  public boolean supportNonUniformScaling() {
    return nel3dJNI.CPSEmitterRectangle_supportNonUniformScaling(swigCPtr, this);
  }

  public void setMatrix(long index, SWIGTYPE_p_NLMISC__CMatrix m) {
    nel3dJNI.CPSEmitterRectangle_setMatrix(swigCPtr, this, index, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(m));
  }

  public SWIGTYPE_p_NLMISC__CMatrix getMatrix(long index) {
    return new SWIGTYPE_p_NLMISC__CMatrix(nel3dJNI.CPSEmitterRectangle_getMatrix(swigCPtr, this, index), true);
  }

  public void setScale(long index, float scale) {
    nel3dJNI.CPSEmitterRectangle_setScale__SWIG_0(swigCPtr, this, index, scale);
  }

  public void setScale(long index, CVector s) {
    nel3dJNI.CPSEmitterRectangle_setScale__SWIG_1(swigCPtr, this, index, CVector.getCPtr(s), s);
  }

  public CVector getScale(long index) {
    return new CVector(nel3dJNI.CPSEmitterRectangle_getScale(swigCPtr, this, index), true);
  }

}
